package com.hospital.warehouse.drugpurchase.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hospital.warehouse.drugdicts.entity.Drugdicts;
import com.hospital.warehouse.sys_user.entity.Sys_user;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author Mr. YR
 * @since 2020-04-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("drugpurchase")
public class Drugpurchase extends Model<Drugpurchase> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "dp_id", type = IdType.AUTO)
    private Integer dp_id;

    @TableField("dp_drugid")
    private Integer dp_drugid;
    @TableField(exist = false)
    private Drugdicts drug;
    
    @TableField("dp_num")
    private Integer dp_num;

    @TableField("dp_price")
    private BigDecimal dp_price;
    
    @TableField(exist = false)
    private BigDecimal dp_price_min;
    @TableField(exist = false)
    private BigDecimal dp_price_max;

    @TableField("dp_applicantid")
    private Integer dp_applicantid;
    @TableField(exist = false)
    private Sys_user applicant;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("dp_createtime")
    private Date dp_createtime;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(exist = false)
    private Date dp_createtime_min;
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date dp_createtime_max;

    @TableField("dp_state")
    private String dp_state;

    @TableField("dp_confirmid")
    private Integer dp_confirmid;
    @TableField(exist = false)
    private Sys_user confirm;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("dp_endtime")
    private Date dp_endtime;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(exist = false)
    private Date dp_endtime_min;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(exist = false)
    private Date dp_endtime_max;

    @TableField("flag")
    private Integer flag;


    @Override
    protected Serializable pkVal() {
        return this.dp_id;
    }

}
